home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 9 / CDACTUAL9.iso / share / Dos / VARIOS / pascal / SAVESCRN.SWG / 0001_Screen Saving + Frames.pas
Encoding:
Pascal/Delphi Source File  |  1996-02-21  |  1.6 KB  |  64 lines

  1. {
  2. Hi All!
  3.  
  4. I've been reading SWAG sources concerning text windows and screen saving many
  5. times. Text windows from SWAG library are quite good and fast. And, what is
  6. much more important, they pushed the screen behind them to the stack - and
  7. when they're disposed they pop it. Quite simple, isn't it?
  8.  
  9. Well, what if you'd like push the screen before you simply _write_ sth to
  10. screen... There's no simple screen saving procedures :((
  11.  
  12. Since now - I've got something quite simple, fast and safe:
  13. }
  14.  
  15. {***************************************************}
  16. {    REWRITTEN FROM ENTER POLISH COMP. MAGAZINE     }
  17. {            BY LUKASZ GRABUN - POLAND              }
  18. {                FIDO: 2:480/49.22                  }
  19. {***************************************************}
  20.  
  21. unit OScreen;
  22.  
  23. interface
  24.  
  25. const pom : Pointer = nil;
  26.  
  27. type  Scrtype = array[1..11352] of byte;
  28.       ScreenType = record
  29.                      scr : scrtype;
  30.                      prev : pointer
  31.                    end;
  32.  
  33. var   SS : ScrType absolute $b800:0;
  34.       Screen : ^ScreenType;
  35.  
  36. procedure PopScreen;
  37. procedure PushScreen;
  38.  
  39. implementation
  40.  
  41. procedure PushScreen;
  42. begin
  43.   new(Screen);
  44.   Screen^.Prev:=Pom;
  45.   Pom:=Screen;
  46.   Screen^.Scr:=SS
  47. end;
  48.  
  49. procedure PopScreen;
  50. begin
  51.   screen:=pom;
  52.   pom:=screen^.prev;
  53.   SS:=Screen^.Scr;
  54.   dispose(screen)
  55. end;
  56.  
  57. end.
  58.  
  59. When you want save screen - simply write PushScreen, and when you want to
  60. restore it - PopScreen. And just one thing: number of used PushScreen
  61. procedures _must be_ equal to number of used PopScreen procs. 
  62. Enjoy!!!
  63.                                            CU L8R! - Wookasz
  64.